<?php if (!defined('THINK_PATH')) exit();?>﻿<!DOCTYPE html>
<html lang="zh">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport"
          content="width=device-width, initial-scale=1, maximum-scale=1.0, minimum-scale=1.0, user-scalable=no">
    <!-- 上述3个meta标签*必须*放在最前面，任何其他内容都*必须*跟随其后！-->
    <title>学生惠后台管理系统</title>
    <link rel="stylesheet" href="/App/Admin/public/css/bootstrap.min.css"/>
    <link rel="stylesheet" href="/App/Admin/public/css/jquery.datetimepicker.css"/>
    <link rel="stylesheet" href="/App/Admin/public/css/style.css"/>
</head>
<body>
<div class="mainBody">
       <div class="mainNav">
        <div class="tit">学生惠后台管理系统</div>
        <div class="navList">
            <ul>
                <li class="active">
                    <a href="<?php echo U("Index/index");?>" class="link"><i class="iconFont left">&#xe602;</i>主页</a>
                </li>
                <li>
                    <a href="<?php echo U("Count/index");?>" class="link"><i class="iconFont left">&#xe750;</i>统计管理</a>
                </li>
                <li>
                    <a href="<?php echo U("Custom/index");?>" class="link"><i class="iconFont left">&#xe650;</i>用户管理</a>
                </li>
                <li>
                    <a href="<?php echo U("shopMange/index");?>" class="link"><i class="iconFont left">&#xe60d;</i>商家管理</a>
                </li>
                <li>
                    <a href="<?php echo U("Order/index");?>" class="link"><i class="iconFont left">&#xe663;</i>订单管理</a>
                </li>
                <li>
                    <a href="<?php echo U("Finance/index");?>" class="link"><i class="iconFont left">&#xe648;</i>财务管理</a>
                </li>
                <li>
                    <a href="<?php echo U("Packet/index");?>" class="link"><i class="iconFont left">&#xe6dc;</i>红包管理</a>
                </li>
                <li>
                    <a href="<?php echo U("Notice/index");?>" class="link"><i class="iconFont left">&#xe601;</i>惠通知</a>
                </li>
                <li>
                    <a href="<?php echo U("Old/index");?>" class="link"><i class="iconFont left">&#xe603;</i>闲置管理</a>
                </li>
                <li>
                    <a href="javascript:;" class="link show"><i class="iconFont left lineHei47">&#xe612;</i>兼职管理<i
                            class="iconFont right">&#xe62e;</i></a>
                    <div class="subNav">
                        <a href="<?php echo U("Job/index");?>">兼职管理</a>
                        <a href="<?php echo U("Jobwant/index");?>">求职管理</a>
                    </div>
                </li>
                <li>
                    <a href="javascript:;" class="link show"><i class="iconFont left lineHei47">&#xe632;</i>系统管理<i
                            class="iconFont right">&#xe62e;</i></a>
                    <div class="subNav">
                        <a href="<?php echo U("Set/index");?>">系统设置</a>
                        <a href="<?php echo U("News/index");?>">公告消息</a>
                        <a href="<?php echo U("Banner/index");?>">BANNER管理</a>
                        <a href="<?php echo U("Rule/index");?>">管理员账号</a>
                        <a href="<?php echo U("Area/index");?>">区域管理</a>
                        <a href="<?php echo U("Feed/index");?>">意见反馈</a>
                    </div>
                </li>
            </ul>
        </div>
    </div>
    
     
    <div class="main">
         <div class="mainTop">
            <a href="<?php echo U('Login/userlogout');?>" class="text"><i class="iconFont">&#xe66e;</i>退出</a>
            <span class="text"><i class="iconFont">&#xe60b;</i><?php echo ($admin_user_name); ?></span>
        </div>

        <div class="subNav">
            <span class="text"><i class="iconFont">&#xe600;</i>订单管理</span>
        </div>

        <div class="indexBox">
            <div class="con-det">
                <div class="row">
                    <div class="col-md-12">
                      <form action="<?php echo U('Order/index');?>" method="post">
                            <table class="formTable">
                                <tbody>
                                <tr>
                                    <td class="name noBor">订单号</td>
                                    <td class="noBor">
                                        <input type="text"  name="order_no"  value="<?php echo ($shArray['order_no']?$shArray['order_no']:''); ?>"  class="inp form-control">
                                    </td>
                                </tr>
                                <tr>
                                    <td class="name noBor">手机号</td>
                                    <td class="noBor">
                                        <input type="text" name="telephone"  value="<?php echo ($shArray['telephone']?$shArray['telephone']:''); ?>" class="inp form-control">
                                    </td>
                                </tr>
                                <tr>
                                    <td class="name noBor">商家名称</td>
                                    <td class="noBor">
                                        <input type="text" name="shop_name"  value="<?php echo ($shArray['shop_name']?$shArray['shop_name']:''); ?>"  class="inp form-control">
                                    </td>
                                </tr>
                                <tr>
                                    <td class="name">下单时间</td>
                                    <td>
                                        <input type="text"  name="from_time" value="<?php echo ($shArray['from_time']?$shArray['from_time']:''); ?>"   class="inp time form-control datetimepicker">
                                        <input type="text"  name="to_time"   value="<?php echo ($shArray['to_time']?$shArray['to_time']:''); ?>" class="inp time form-control datetimepicker">
                                    </td>
                                </tr>
                                <tr>
                                    <td class="name">订单状态</td>
                                    <td>
                                        <select class="inp form-control">
                                            <option>全部</option>
                                        </select>
                                    </td>
                                </tr>
                                <tr>
                                    <td class="name"></td>
                                    <td>
                                        <button class="btn btn-primary blue" type="submit">查询</button>
                                    </td>
                                </tr>
                                </tbody></table>
                        </form>
                    </div>
                </div>

                <div class="mt40 listBox">
                    <div class="listScroll">
                        <table class="table table-striped">
                            <tr>
                                <th>订单号</th>
                                <th>订单商品</th>
                                <th>订单金额</th>
                                <th>下单时间</th>
                                <th>客户姓名</th>
                                <th>客户手机号</th>
                                <th>配送地址</th>
                                <th>送达时间</th>
                                <th>商家名称</th>
                                <th>商家电话</th>
                                <th>支付状态</th>
                                <th>订单状态</th>
                                 <th>消费类型</th>
                                <th>操作</th>
                            </tr>
                            
                            <?php if(is_array($list) && !empty($list) ): foreach($list as $key=>$item): ?><tr>
                                <td><?php echo ($item["order_no"]); ?></td>
                                <td><?php echo ($item["pro_name"]); ?></td>
                                <td><?php echo ($item["total_cost"]); ?></td>
                                <td><?php echo (date('Y-m-d',$item["add_time"])); ?></td>
                                <td><?php echo ($item["fullname"]); ?></td>
                                <td><?php echo ($item["phone"]); ?></td>
                                <td><?php echo ($item["address1"]); ?></td>
                                <td><?php echo ($item["confirm_time"]); ?></td>
                                <td><?php echo ($item["shop_name"]); ?></td>
                                <td><?php echo ($item["telephone"]); ?></td>
                                <td><?php echo ($item['pay_status_value']?$item['pay_status_value']:'已支付'); ?></td>
                                <td><?php echo ($item["order_status_value"]); ?></td>
                                 <td><?php echo ($item["cost_type_name"]); ?></td>
                                <td>
                                    <a href="<?php echo U('Order/editOrder','id='.$item['id']);?>" class="btn btn-default btn-xs">详情</a>
                                    <a href="javacript:void(0);" cid="<?php echo ($item['id']); ?>" pay_status="<?php echo ($item['pay_status']); ?>"  cost_type="<?php echo ($item['cost_type']); ?>" order_status="<?php echo ($item['order_status']); ?>" class="btn btn-default btn-xs  btn-canel-order">取消订单</a>
                                    <a href="<?php echo U('Order/refund_order','id='.$item['id'].'&order_status='.$item['order_status'].'&cost_type='.$item['cost_type']);?>;" class="btn btn-default btn-xs btn-refund-order">退款</a>
                                </td>
                            </tr><?php endforeach; else: endif; ?>
                        </table>
                    </div>
                    <nav aria-label="Page navigation">
                        <ul class="pagination fr">
                           <?php echo ($page); ?>
                        </ul>
                    </nav>
                </div>
            </div>
        </div>
    </div>
</div>


<div class="modal fade popupRefund" tabindex="-1" role="dialog">
    <div class="modal-dialog" role="document">
        <div class="modal-content">
            <div class="modal-header">
                <button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">&times;</span></button>
                <h4 class="modal-title">提示：</h4>
            </div>
            <div class="modal-body">
                <p>请确认是否进行退款！</p>
            </div>
            <div class="modal-footer">
                <button type="button" class="btn btn-default" data-dismiss="modal">取消</button>
                <button type="button" class="btn btn-primary blue">确认</button>
            </div>
        </div>
    </div>
</div>

<div class="modal fade popupCancel" tabindex="-1" role="dialog">
    <div class="modal-dialog" role="document">
        <div class="modal-content">
            <div class="modal-header">
                <button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">&times;</span></button>
                <h4 class="modal-title">提示：</h4>
            </div>
            <div class="modal-body">
                <p>请确认是否进行取消订单！</p>
            </div>
            <div class="modal-footer">
                <button type="button" class="btn btn-default" data-dismiss="modal">取消</button>
                <button type="button" class="btn btn-primary blue">确认</button>
            </div>
        </div>
    </div>
</div>

<script type="text/javascript" src="/App/Admin/public/js/jquery-2.1.1.min.js"></script>
<script type="text/javascript" src="/App/Admin/public/js/jquery.datetimepicker.js"></script>
<script type="text/javascript" src="/App/Admin/public/js/bootstrap.min.js"></script>
<script type="text/javascript" src="/App/Admin/public/js/time.js"></script>
<script type="text/javascript" src="/App/Admin/public/js/public.js"></script>
<script>
    $(".btn-canel-order").click(function(){
        var cid=$(this).attr('cid');
        var pay_status = $(this).attr('pay_status');
        var cost_type = $(this).attr('cost_type');
        var order_status = $(this).attr('order_status');
    	$.post('<?php echo U('Order/canel_order');?>',{cid:cid,pay_status:pay_status,cost_type:cost_type,order_status:order_status},function(data){
            
               alert(data.info);
            
        });
    })
</script>

</body>
</html>